<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" %>
<%@ page import="com.grep.web.IndexService,java.util.*,com.grep.extra.factory.data.impl.SiteUrl"%>
<%@ include file="../common/taglibs.jsp" %>
<%@ include file="../common/ckeckuser.jsp" %>
<%
	request.setCharacterEncoding("UTF-8");
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	IndexService indexService = new IndexService();
	List<SiteUrl> allSites = indexService.getAllSites();

	request.setAttribute("allSites", allSites);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>任务URL管理</title>
<script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="../js/common.js" type="text/javascript"></script>
<script src="../js/taskurlmanager.js" type="text/javascript"></script>
<link href="${base }/style/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
	<%@ include file="../common/header.jsp"%>
	<%@ include file="../common/manager_menu.jsp"%>
	<div id="sider_right">
		<img src="${base }/images/rightbordertop.jpg" class="imgfloat" />
		<div id="sr_cont" class="siderborder">
			<img src="${base }/images/neing.jpg" class="imgfloat" width="724" />
			<div id="newzd">
				<div class="tabcontainer">
					<form method="post" style="margin-bottom:10px;">
						<span style="float: left; margin-right: 25px;">
							<select	id="selectwebsite">
								<option value="null" >请先选择站点</option>
								<c:forEach var="site" items="${allSites}" varStatus="status">
									<option value="${site.id}">${site.siteName}</option>
								</c:forEach>
							</select>							
						</span> 
						<span style="float:left; margin-right:25px;">
							<select id="selecttask">
								<option value="null" >请先选择任务</option>
								 
							</select>
						</span>
						 
						<span class="looknew" id="newtask">
							<a href="javascript:void(0)" onclick="displayaddtaskurl()">添加URL</a>
						</span>

					</form>
					<div id="displaytable">
						<span id="nonedata" >暂无数据，可以首先选择站点，然后查看任务，即可看到相应数据或者选择站点，选择任务，进行新建URl</span>
						<div id="displaytaskdata" style="width: 700px; padding: 0; float: left;">	
						</div>
						<div class="tabcontainer" id="fenye" style="display:none">              
                       		<span id="shouye"class="sfpn" style="float:left;display:none"><a href="javascript:void(0)" onclick="shouye()">首页</a></span>                       		
                       		<span id="prevpage" class="sfpn" style="float:left;display:none"><a href="javascript:void(0)" onclick="prevpage()">上一页</a></span>                     	
                       		<ul id="fenyenum"></ul>	
			                <span id="nextpage" class="sfpn" style="float:left;display:none"><a href="javascript:void(0)" onclick="nextpage()">下一页</a></span>
			                <span id="lastpage" class="sfpn" style="float:left;display:none"><a href="javascript:void(0)" onclick="lastpage()">末页</a></span>			                
	                    	<span id="dangqian_count" class="sfpn"></span>				                    		                  		
			            </div> 
					</div>
				</div>
			</div>
			<div id="displaynewtaskurl" class="ajaxdisplay">
				<form method="post"> 
						<span id="newzd_tit">
							<samp id="newzdxuan">配置任务URL</samp>
						</span>							
						<span  id="csdz" style="width:590px;">
							<label for="addtasklink">Url配置:</label>
							<input type="text" onkeyup="isnull('addtasklink')" id="addtasklink" class="cjinput" name="urllink" />
							<span id="addtasklink_0" class="inputtishi">URL不能为空</span>
						</span>						
						<input type="button" onclick="addtaskurl()" value="完成" id="next"  style="margin-left:15px; display:inline;" />
				</form>	
				<div>
					<a class="p_h_x" onclick="hideDiv('displaynewtaskurl')" title="关闭窗口">X</a>
				</div>			
			</div>
			<div id="displaymodifictaskurl" class="ajaxdisplay">
					<form  method="post">
						<span id="newzd_tit">
							<samp id="newzdxuan">修改任务URl</samp>
						</span> 
						 <span  id="csdz" style="width:590px;">
							<label for="cjpeizhi">Url配置:</label>
							<input type="text" onkeyup="isnull('cjpeizhi')" id="cjpeizhi" class="cjinput" name="urllink" />
							<input type="hidden" id="pzurlid" value="" />
							<span id="cjpeizhi_0" class="inputtishi">URL不能为空</span>
						</span>	
						<input type="button" value="修改" id="next" onclick="modifictaskurl()"  style="display: inline;" />
					</form>
					<div>
						<a class="p_h_x" onclick="hideDiv('displaymodifictaskurl')" title="关闭窗口">X</a>
					</div>
				</div>
		</div>
	<img src="${base }/images/rightborderbuttom.jpg" class="imgfloat" />
	</div>
</body>
</html>